<script type="text/javascript" src="<?=BASE_URL()?>java_scripts/vote_scripts.js"></script>
<?php 
	$error_msg=(!isset($error))?"":$error;
?>
	<h3 class="capture">Vote Management</h3>
    <div id="wrap">
    
    <div id="tdd_selected">
    	<div class="dd_selected">Update - Vote Item Category</div>
        <div class="dd_view">
        
		   <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
		      <tr>
		      	<td align="center">
			      	<form action="" method="post">
			      		<?php 
			      			foreach($categories->result_array() as $category){
			      			$id=(!isset($error))?$category['vote_item_cat_id']:$cat_id;
			      			$desc=(!isset($error))?$category['vote_item_cat_desc']:$cat_desc;
			      		?>
			      		<table border="0" cellpadding="0" cellspacing="0" width="80%">
			      			<tr align="center">
			      				<td height="55">
			      				<input type="hidden" name="txtcatid" value="<?=$id?>">
			      				Category Name :&nbsp;&nbsp;&nbsp;<input type="text" name="txtcat" id="txtcat" value="<?=$desc?>" maxlength="255" style="width: 250px;" /><div id='existing'><?=$error_msg?></div>
			      				</td>
			      			</tr>
			      			<tr align="center">
			      				<td height="20"><input type="button" class="button_back_end" onclick="javascript:window.location='<?=site_url("vote_management/itemCategory")?>'" style="cursor: pointer;" value="Back"/>&nbsp;&nbsp;<input type="button" class="button_back_end" onclick="javascript:updateCategory('<?=site_url("vote_management/updateCategory")?>')" style="cursor: pointer;" value="Update"/></td>
			      			</tr>
			      		</table>
			      		<?php 
			      			}
			      		?>
			      	</form>
		      	</td>
		      </tr>
		   </table><br />
</div>
</div>
</div>
